# Maintainer: JackNapier <jacknapier151@gmail.com>
# Contributor: 

##########
# Godot4 #
##########
pkgname=(
	"godot4-stable-src"
	##################
	# Godot GDScript #
	##################
	"godot4-stable-bin"
	"godot4-stable-bin32"
	"godot4-stable-export-templates-bin"
	"libgodot4-stable-bin"
	"godot4-stable-web-bin"
	"godot4-stable-osx-bin"
	"godot4-stable-win32-bin"
	"godot4-stable-win64-bin"
	"godot4-stable-android-apk-bin"
	"godot4-stable-android-apk-bin"
	##############
	# Godot Mono #
	##############
	"godot4-stable-mono-bin"
	"godot4-stable-mono-bin32"
	"godot4-stable-mono-export-templates-bin"
	"godot4-stable-mono-osx-bin"
	"godot4-stable-mono-win32-bin"
	"godot4-stable-mono-win64-bin"
	)
pkgver="4.2"
pkgrel=1
pkgdesc="Godot4 Game Engine: An advanced, feature packed, multi-platform 2D and 3D game engine."
url="http://www.godotengine.org"
license=("MIT")
groups=(
	"godot-full"
	"godot4"
	"godot42"
	"godot-bin"
	"godot-rc"
)
arch=("any")
_monodepends=(
	"mono>=6.12.0"
	"dotnet-sdk"
	"msbuild"
)
depends=(
	"godot-base"
	"alsa-lib"
	"freetype2"
	"glu"
	"libxcursor"
	"libxinerama"
	"mesa"
)

source=("https://downloads.tuxfamily.org/godotengine/${pkgver}/godot-${pkgver}-stable.tar.xz")
sha512sums=("SKIP")
package_godot4-stable-src(){
	pkgdesc+=" Stable SourceCode"
	groups+=(
		"godot-src"
	)
	install -d "${pkgdir}/opt/godot/src/godot4-stable/"
	cp -r "${srcdir}/godot-${pkgver}-stable/"* "${pkgdir}/opt/godot/src/godot4-stable/"
}

##################
# Godot GDScript #
##################

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_linux.x86_64.zip")
sha512sums+=("SKIP")
package_godot4-stable-bin(){
	pkgdesc+=" Stable Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_64" "${pkgdir}/opt/godot/godot4-stable-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-stable-bin" "${pkgdir}/usr/bin/godot4-stable-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-stable-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Stable Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot4-stable-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_linux.x86_32.zip")
sha512sums+=("SKIP")
package_godot4-stable-bin32(){
	pkgdesc+=" Stable Binary Version 32b"
	groups+=(
		"godot-gdscript"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_32" "${pkgdir}/opt/godot/godot4-stable-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-stable-bin32" "${pkgdir}/usr/bin/godot4-stable-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-stable-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Stable Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Binary Version 32b"
		Comment=Application for making games
		Exec=/usr/bin/godot4-stable-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_export_templates.tpz")
noextract=("Godot_v${pkgver}-stable_export_templates.tpz")
sha512sums+=("SKIP")
package_godot4-stable-export-templates-bin(){
	pkgdesc+=" Stable Export Templates Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_export_templates.tpz" "${pkgdir}/opt/godot/godot4-stable-export-templates-bin.tpz"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/godot-lib.${pkgver}.stable.template_release.aar")
noextract+=("godot-lib.${pkgver}.stable.template_release.aar")
sha512sums+=("SKIP")
package_libgodot4-stable-bin(){
	pkgdesc+=" Stable LibGodot Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-lib"
	)
	install -Dm755 "${srcdir}/godot-lib.${pkgver}.stable.template_release.aar" "${pkgdir}/opt/godot/godot-lib/libgodot4-stable-bin.aar"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_web_editor.zip")
noextract+=("Godot_v${pkgver}-stable_web_editor.zip")
sha512sums+=("SKIP")
package_godot4-stable-web-bin(){
	pkgdesc+=" Stable Web Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-web"
	)
	unzip "Godot_v${pkgver}-stable_web_editor.zip" -d "${srcdir}/godot4-stable-web-bin.d"
	install -d "${pkgdir}/opt/godot/"
	cp -r "${srcdir}/godot4-stable-web-bin.d" "${pkgdir}/opt/godot/"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_macos.universal.zip")
sha512sums+=("SKIP")
package_godot4-stable-osx-bin(){
	pkgdesc+=" Stable MacOSX Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot4-stable-osx-bin"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_win32.exe.zip")
sha512sums+=("SKIP")
package_godot4-stable-win32-bin(){
	pkgdesc+=" Stable Windows Binary Version 32b"
	groups+=(
		"godot-gdscript"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32.exe" "${pkgdir}/opt/godot/godot4-stable-win32-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.cmd" "${pkgdir}/opt/godot/godot4-stable-win32-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.exe" "${pkgdir}/opt/godot/godot4-stable-win32cmd-bin.exe"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_win64.exe.zip")
sha512sums+=("SKIP")
package_godot4-stable-win64-bin(){
	pkgdesc+=" Stable Windows Binary Version 64b"
	groups+=(
		"godot-gdscript"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64.exe" "${pkgdir}/opt/godot/godot4-stable-win64-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.cmd" "${pkgdir}/opt/godot/godot4-stable-win64-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.exe" "${pkgdir}/opt/godot/godot4-stable-win64cmd-bin.exe"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_android_editor.apk")
noextract+=("Godot_v${pkgver}-stable_android_editor.apk")
sha512sums+=("SKIP")
package_godot4-stable-android-apk-bin(){
	pkgdesc+=" Stable Android APK Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-android-apk"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.apk" "${pkgdir}/opt/godot/godot4-stable-android-bin.apk"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/Godot_v${pkgver}-stable_android_editor.aab")
noextract+=("Godot_v${pkgver}-stable_android_editor.aab")
sha512sums+=("SKIP")
package_godot4-stable-android-aab-bin(){
	pkgdesc+=" Stable Android AAB Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-android-aab"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.aab" "${pkgdir}/opt/godot/godot4-stable-android-bin.aab"
}

##############
# Godot Mono #
##############
source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_linux_x86_64.zip")
sha512sums+=("SKIP")
package_godot4-stable-mono-bin(){
	pkgdesc+=" Stable Mono Binary Version"
	depends+=("${_monodepends}")
	groups+=(
		"godot-mono"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/Godot_v${pkgver}-stable_mono_linux.x86_64" "${pkgdir}/opt/godot/godot4-stable-mono-bin.d/godot4-stable-mono-bin"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/GodotSharp" "${pkgdir}/opt/godot/godot4-stable-mono-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-stable-mono-bin.d/godot4-stable-mono-bin" "${pkgdir}/opt/godot/godot4-stable-mono-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-stable-mono-bin.d/godot4-stable-mono-bin" "${pkgdir}/usr/bin/godot4-stable-mono-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-stable-mono-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Stable Mono Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Mono Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot4-stable-mono-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_linux_x86_32.zip")
sha512sums+=("SKIP")
package_godot4-stable-mono-bin32(){
	pkgdesc+=" Stable Mono Binary Version 32b"
	depends+=("${_monodepends}")
	groups+=(
		"godot-mono"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/Godot_v${pkgver}-stable_mono_linux.x86_32" "${pkgdir}/opt/godot/godot4-stable-mono-bin32.d/godot4-stable-mono-bin32"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/GodotSharp" "${pkgdir}/opt/godot/godot4-stable-mono-bin32.d/GodotSharp"
	ln -s "/opt/godot/godot4-stable-mono-bin32.d/godot4-stable-mono-bin32" "${pkgdir}/opt/godot/godot4-stable-mono-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-stable-mono-bin32.d/godot4-stable-mono-bin32" "${pkgdir}/usr/bin/godot4-stable-mono-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-stable-mono-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Stable Mono Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Mono Binary Version 32b"
		Comment=Application for making games.
		Exec=/usr/bin/godot4-stable-mono-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_export_templates.tpz")
noextract+=("Godot_v${pkgver}-stable_mono_export_templates.tpz")
sha512sums+=("SKIP")
package_godot4-stable-mono-export-templates-bin(){
	pkgdesc+=" Stable Export Templates Mono Binary Version"
	groups+=(
		"godot-mono"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_export_templates.tpz" "${pkgdir}/opt/godot/godot4-stable-mono-export-templates-bin.tpz"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_macos.universal.zip")
sha512sums+=("SKIP")
package_godot4-stable-mono-osx-bin(){
	pkgdesc+=" Stable MacOSX Mono Binary Version"
	groups+=(
		"godot-mono"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot_mono.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot4-stable-mono-osx-bin.d/godot4-stable-mono-osx-bin"
	cp -r "${srcdir}/Godot_mono.app/Contents/Resources/GodotSharp" "${pkgdir}/opt/godot/godot4-stable-mono-osx-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-stable-mono-osx-bin.d/godot4-stable-mono-osx-bin" "${pkgdir}/opt/godot/godot4-stable-mono-osx-bin"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_win32.zip")
sha512sums+=("SKIP")
package_godot4-stable-mono-win32-bin(){
	pkgdesc+=" Stable Windows Mono Binary Version 32b"
	groups+=(
		"godot-mono"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win32-bin.d/godot4-stable-mono-win32-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32_console.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win32-bin.d/godot4-stable-mono-win32cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win32/GodotSharp" "${pkgdir}/opt/godot/godot4-stable-mono-win32-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-stable-mono-win32-bin.d/godot4-stable-mono-win32-bin.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win32-bin.exe"
	ln -s "/opt/godot/godot4-stable-mono-win32-bin.d/godot4-stable-mono-win32cmd-bin.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win32cmd-bin.exe"
}

source+=("https://downloads.tuxfamily.org/godotengine/${pkgver}/mono/Godot_v${pkgver}-stable_mono_win64.zip")
sha512sums+=("SKIP")
package_godot4-stable-mono-win64-bin(){
	pkgdesc+=" Stable Windows Mono Binary Version 64b"
	groups+=(
		"godot-mono"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win64-bin.d/godot4-stable-mono-win64-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64_console.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win64-bin.d/godot4-stable-mono-win64cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win64/GodotSharp" "${pkgdir}/opt/godot/godot4-stable-mono-win64-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-stable-mono-win64-bin.d/godot4-stable-mono-win64-bin.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win64-bin.exe"
	ln -s "/opt/godot/godot4-stable-mono-win64-bin.d/godot4-stable-mono-win64cmd-bin.exe" "${pkgdir}/opt/godot/godot4-stable-mono-win64cmd-bin.exe"
}

#########
# Godot #
#########

pkgname+=(
	"godot-stable-src"
	##################
	# Godot GDScript #
	##################
	"godot-stable-bin"
	"godot-stable-bin32"
	"godot-stable-export-templates-bin"
	"libgodot-stable-bin"
	"godot-stable-web-bin"
	"godot-stable-osx-bin"
	"godot-stable-win32-bin"
	"godot-stable-win64-bin"
	"godot-stable-android-apk-bin"
	"godot-stable-android-aab-bin"
	##############
	# Godot Mono #
	##############
	"godot-stable-mono-bin"
	"godot-stable-mono-bin32"
	"godot-stable-mono-export-templates-bin"
	"godot-stable-mono-osx-bin"
	"godot-stable-mono-win32-bin"
	"godot-stable-mono-win64-bin"
	)

pkgdescalt="Godot Game Engine: An advanced, feature packed, multi-platform 2D and 3D game engine."

package_godot-stable-src(){
	pkgdesc="${pkgdescalt} Stable SourceCode"
	groups+=(
		"godot-src"
	)
	install -d "${pkgdir}/opt/godot/src/godot-stable/"
	cp -r "${srcdir}/godot-${pkgver}-stable/"* "${pkgdir}/opt/godot/src/godot-stable/"
}

##################
# Godot GDScript #
##################

package_godot-stable-bin(){
	pkgdesc="${pkgdescalt} Stable Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_64" "${pkgdir}/opt/godot/godot-stable-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-stable-bin" "${pkgdir}/usr/bin/godot-stable-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-stable-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Stable Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot-stable-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-stable-bin32(){
	pkgdesc="${pkgdescalt} Stable Binary Version 32b"
	groups+=(
		"godot-gdscript"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_32" "${pkgdir}/opt/godot/godot-stable-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-stable-bin32" "${pkgdir}/usr/bin/godot-stable-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-stable-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Stable Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Binary Version 32b"
		Comment=Application for making games
		Exec=/usr/bin/godot-stable-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-stable-export-templates-bin(){
	pkgdesc="${pkgdescalt} Stable Export Templates Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_export_templates.tpz" "${pkgdir}/opt/godot/godot-stable-export-templates-bin.tpz"
}

package_libgodot-stable-bin(){
	pkgdesc="${pkgdescalt} Stable LibGodot Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-lib"
	)
	install -Dm755 "${srcdir}/godot-lib.${pkgver}.stable.template_release.aar" "${pkgdir}/opt/godot/godot-lib/libgodot-stable-bin.aar"
}

package_godot-stable-web-bin(){
	pkgdesc="${pkgdescalt} Stable Web Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-web"
	)
	unzip "Godot_v${pkgver}-stable_web_editor.zip" -d "${srcdir}/godot-stable-web-bin.d"
	install -d "${pkgdir}/opt/godot/"
	cp -r "${srcdir}/godot-stable-web-bin.d" "${pkgdir}/opt/godot/"
}

package_godot-stable-osx-bin(){
	pkgdesc="${pkgdescalt} Stable MacOSX Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot-stable-osx-bin"
}

package_godot-stable-win32-bin(){
	pkgdesc="${pkgdescalt} Stable Windows Binary Version 32b"
	groups+=(
		"godot-gdscript"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32.exe" "${pkgdir}/opt/godot/godot-stable-win32-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.cmd" "${pkgdir}/opt/godot/godot-stable-win32-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.exe" "${pkgdir}/opt/godot/godot-stable-win32cmd-bin.exe"
}

package_godot-stable-win64-bin(){
	pkgdesc="${pkgdescalt} Stable Windows Binary Version 64b"
	groups+=(
		"godot-gdscript"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64.exe" "${pkgdir}/opt/godot/godot-stable-win64-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.cmd" "${pkgdir}/opt/godot/godot-stable-win64-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.exe" "${pkgdir}/opt/godot/godot-stable-win64cmd-bin.exe"
}

package_godot-stable-android-bin(){
	pkgdesc="${pkgdescalt} Stable Android APK Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-android-apk"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.apk" "${pkgdir}/opt/godot/godot-stable-android-bin.apk"
}

package_godot-stable-android-bin(){
	pkgdesc="${pkgdescalt} Stable Android AAB Binary Version"
	groups+=(
		"godot-gdscript"
		"godot-android-aab"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.aab" "${pkgdir}/opt/godot/godot-stable-android-bin.aab"
}

##############
# Godot Mono #
##############
package_godot-stable-mono-bin(){
	pkgdesc="${pkgdescalt} Stable Mono Binary Version"
	depends+=("${_monodepends}")
	groups+=(
		"godot-mono"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/Godot_v${pkgver}-stable_mono_linux.x86_64" "${pkgdir}/opt/godot/godot-stable-mono-bin.d/godot-stable-mono-bin"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/GodotSharp" "${pkgdir}/opt/godot/godot-stable-mono-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-stable-mono-bin.d/godot-stable-mono-bin" "${pkgdir}/opt/godot/godot-stable-mono-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-stable-mono-bin.d/godot-stable-mono-bin" "${pkgdir}/usr/bin/godot-stable-mono-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-stable-mono-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Stable Mono Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Mono Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot-stable-mono-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-stable-mono-bin32(){
	pkgdesc="${pkgdescalt} Stable Mono Binary Version 32b"
	depends+=("${_monodepends}")
	groups+=(
		"godot-mono"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/Godot_v${pkgver}-stable_mono_linux.x86_32" "${pkgdir}/opt/godot/godot-stable-mono-bin32.d/godot-stable-mono-bin32"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/GodotSharp" "${pkgdir}/opt/godot/godot-stable-mono-bin32.d/GodotSharp"
	ln -s "/opt/godot/godot-stable-mono-bin32.d/godot-stable-mono-bin32" "${pkgdir}/opt/godot/godot-stable-mono-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-stable-mono-bin32.d/godot-stable-mono-bin32" "${pkgdir}/usr/bin/godot-stable-mono-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-stable-mono-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Stable Mono Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Stable Mono Binary Version 32b"
		Comment=Application for making games.
		Exec=/usr/bin/godot-stable-mono-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-stable-mono-export-templates-bin(){
	pkgdesc="${pkgdescalt} Stable Export Templates Mono Binary Version"
	groups+=(
		"godot-mono"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_export_templates.tpz" "${pkgdir}/opt/godot/godot-stable-mono-export-templates-bin.tpz"
}


package_godot-stable-mono-osx-bin(){
	pkgdesc="${pkgdescalt} Stable MacOSX Mono Binary Version"
	groups+=(
		"godot-mono"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot_mono.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot-stable-mono-osx-bin.d/godot-stable-mono-osx-bin"
	cp -r "${srcdir}/Godot_mono.app/Contents/Resources/GodotSharp" "${pkgdir}/opt/godot/godot-stable-mono-osx-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-stable-mono-osx-bin.d/godot-stable-mono-osx-bin" "${pkgdir}/opt/godot/godot-stable-mono-osx-bin"
}

package_godot-stable-mono-win32-bin(){
	pkgdesc="${pkgdescalt} Stable Windows Mono Binary Version 32b"
	groups+=(
		"godot-mono"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32.exe" "${pkgdir}/opt/godot/godot-stable-mono-win32-bin.d/godot-stable-mono-win32-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32_console.exe" "${pkgdir}/opt/godot/godot-stable-mono-win32-bin.d/godot-stable-mono-win32cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win32/GodotSharp" "${pkgdir}/opt/godot/godot-stable-mono-win32-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-stable-mono-win32-bin.d/godot-stable-mono-win32-bin.exe" "${pkgdir}/opt/godot/godot-stable-mono-win32-bin.exe"
	ln -s "/opt/godot/godot-stable-mono-win32-bin.d/godot-stable-mono-win32cmd-bin.exe" "${pkgdir}/opt/godot/godot-stable-mono-win32cmd-bin.exe"
}

package_godot-stable-mono-win64-bin(){
	pkgdesc="${pkgdescalt} Stable Windows Mono Binary Version 64b"
	groups+=(
		"godot-mono"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64.exe" "${pkgdir}/opt/godot/godot-stable-mono-win64-bin.d/godot-stable-mono-win64-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64_console.exe" "${pkgdir}/opt/godot/godot-stable-mono-win64-bin.d/godot-stable-mono-win64cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win64/GodotSharp" "${pkgdir}/opt/godot/godot-stable-mono-win64-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-stable-mono-win64-bin.d/godot-stable-mono-win64-bin.exe" "${pkgdir}/opt/godot/godot-stable-mono-win64-bin.exe"
	ln -s "/opt/godot/godot-stable-mono-win64-bin.d/godot-stable-mono-win64cmd-bin.exe" "${pkgdir}/opt/godot/godot-stable-mono-win64cmd-bin.exe"
}


################
# Godot Latest #
################

pkgname+=(
	"godot-latest-src"
	##################
	# Godot GDScript #
	##################
	"godot-latest-bin"
	"godot-latest-bin32"
	"godot-latest-export-templates-bin"
	"libgodot-latest-bin"
	"godot-latest-web-bin"
	"godot-latest-osx-bin"
	"godot-latest-win32-bin"
	"godot-latest-win64-bin"
	"godot-latest-android-apk-bin"
	"godot-latest-android-aab-bin"
	##############
	# Godot Mono #
	##############
	"godot-latest-mono-bin"
	"godot-latest-mono-bin32"
	"godot-latest-mono-export-templates-bin"
	"godot-latest-mono-osx-bin"
	"godot-latest-mono-win32-bin"
	"godot-latest-mono-win64-bin"
	)

pkgdesclatest="Godot Latest Game Engine: An advanced, feature packed, multi-platform 2D and 3D game engine."

package_godot-latest-src(){
	pkgdesc="${pkgdesclatest} Latest SourceCode"
	groups+=(
		"godot-latest"
		"godot-src"
	)
	install -d "${pkgdir}/opt/godot/src/godot-latest/"
	cp -r "${srcdir}/godot-${pkgver}-stable/"* "${pkgdir}/opt/godot/src/godot-latest/"
}

##################
# Godot GDScript #
##################

package_godot-latest-bin(){
	pkgdesc="${pkgdesclatest} Latest Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_64" "${pkgdir}/opt/godot/godot-latest-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-latest-bin" "${pkgdir}/usr/bin/godot-latest-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-latest-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Latest Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot-latest-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-latest-bin32(){
	pkgdesc="${pkgdesclatest} Latest Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_32" "${pkgdir}/opt/godot/godot-latest-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-latest-bin32" "${pkgdir}/usr/bin/godot-latest-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-latest-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Latest Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Binary Version 32b"
		Comment=Application for making games
		Exec=/usr/bin/godot-latest-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-latest-export-templates-bin(){
	pkgdesc="${pkgdesclatest} Latest Export Templates Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_export_templates.tpz" "${pkgdir}/opt/godot/godot-latest-export-templates-bin.tpz"
}

package_libgodot-latest-bin(){
	pkgdesc="${pkgdesclatest} Latest LibGodot Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-lib"
	)
	install -Dm755 "${srcdir}/godot-lib.${pkgver}.stable.template_release.aar" "${pkgdir}/opt/godot/godot-lib/libgodot-latest-bin.aar"
}

package_godot-latest-web-bin(){
	pkgdesc="${pkgdesclatest} Latest Web Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-web"
	)
	unzip "Godot_v${pkgver}-stable_web_editor.zip" -d "${srcdir}/godot-latest-web-bin.d"
	install -d "${pkgdir}/opt/godot/"
	cp -r "${srcdir}/godot-latest-web-bin.d" "${pkgdir}/opt/godot/"
}

package_godot-latest-osx-bin(){
	pkgdesc="${pkgdesclatest} Latest MacOSX Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot-latest-osx-bin"
}

package_godot-latest-win32-bin(){
	pkgdesc="${pkgdesclatest} Latest Windows Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32.exe" "${pkgdir}/opt/godot/godot-latest-win32-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.cmd" "${pkgdir}/opt/godot/godot-latest-win32-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.exe" "${pkgdir}/opt/godot/godot-latest-win32cmd-bin.exe"
}

package_godot-latest-win64-bin(){
	pkgdesc="${pkgdesclatest} Latest Windows Binary Version 64b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64.exe" "${pkgdir}/opt/godot/godot-latest-win64-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.cmd" "${pkgdir}/opt/godot/godot-latest-win64-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.exe" "${pkgdir}/opt/godot/godot-latest-win64cmd-bin.exe"
}

package_godot-latest-android-apk-bin(){
	pkgdesc="${pkgdesclatest} Latest Android APK Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-android-apk"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.apk" "${pkgdir}/opt/godot/godot-latest-android-bin.apk"
}

package_godot-latest-android-aab-bin(){
	pkgdesc="${pkgdesclatest} Latest Android AAB Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-android-aab"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.aab" "${pkgdir}/opt/godot/godot-latest-android-bin.aab"
}

##############
# Godot Mono #
##############
package_godot-latest-mono-bin(){
	pkgdesc="${pkgdesclatest} Latest Mono Binary Version"
	depends+=("${_monodepends}")
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/Godot_v${pkgver}-stable_mono_linux.x86_64" "${pkgdir}/opt/godot/godot-latest-mono-bin.d/godot-latest-mono-bin"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/GodotSharp" "${pkgdir}/opt/godot/godot-latest-mono-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-latest-mono-bin.d/godot-latest-mono-bin" "${pkgdir}/opt/godot/godot-latest-mono-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-latest-mono-bin.d/godot-latest-mono-bin" "${pkgdir}/usr/bin/godot-latest-mono-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-latest-mono-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Latest Mono Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Mono Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot-latest-mono-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-latest-mono-bin32(){
	pkgdesc="${pkgdesclatest} Latest Mono Binary Version 32b"
	depends+=("${_monodepends}")
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/Godot_v${pkgver}-stable_mono_linux.x86_32" "${pkgdir}/opt/godot/godot-latest-mono-bin32.d/godot-latest-mono-bin32"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/GodotSharp" "${pkgdir}/opt/godot/godot-latest-mono-bin32.d/GodotSharp"
	ln -s "/opt/godot/godot-latest-mono-bin32.d/godot-latest-mono-bin32" "${pkgdir}/opt/godot/godot-latest-mono-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot-latest-mono-bin32.d/godot-latest-mono-bin32" "${pkgdir}/usr/bin/godot-latest-mono-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot-latest-mono-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot Engine Latest Mono Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Mono Binary Version 32b"
		Comment=Application for making games.
		Exec=/usr/bin/godot-latest-mono-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot-latest-mono-export-templates-bin(){
	pkgdesc="${pkgdesclatest} Latest Export Templates Mono Binary Version"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_export_templates.tpz" "${pkgdir}/opt/godot/godot-latest-mono-export-templates-bin.tpz"
}

package_godot-latest-mono-osx-bin(){
	pkgdesc="${pkgdesclatest} Latest MacOSX Mono Binary Version"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot_mono.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot-latest-mono-osx-bin.d/godot-latest-mono-osx-bin"
	cp -r "${srcdir}/Godot_mono.app/Contents/Resources/GodotSharp" "${pkgdir}/opt/godot/godot-latest-mono-osx-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-latest-mono-osx-bin.d/godot-latest-mono-osx-bin" "${pkgdir}/opt/godot/godot-latest-mono-osx-bin"
}

package_godot-latest-mono-win32-bin(){
	pkgdesc="${pkgdesclatest} Latest Windows Mono Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32.exe" "${pkgdir}/opt/godot/godot-latest-mono-win32-bin.d/godot-latest-mono-win32-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32_console.exe" "${pkgdir}/opt/godot/godot-latest-mono-win32-bin.d/godot-latest-mono-win32cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win32/GodotSharp" "${pkgdir}/opt/godot/godot-latest-mono-win32-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-latest-mono-win32-bin.d/godot-latest-mono-win32-bin.exe" "${pkgdir}/opt/godot/godot-latest-mono-win32-bin.exe"
	ln -s "/opt/godot/godot-latest-mono-win32-bin.d/godot-latest-mono-win32cmd-bin.exe" "${pkgdir}/opt/godot/godot-latest-mono-win32cmd-bin.exe"
}

package_godot-latest-mono-win64-bin(){
	pkgdesc="${pkgdesclatest} Latest Windows Mono Binary Version 64b"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64.exe" "${pkgdir}/opt/godot/godot-latest-mono-win64-bin.d/godot-latest-mono-win64-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64_console.exe" "${pkgdir}/opt/godot/godot-latest-mono-win64-bin.d/godot-latest-mono-win64cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win64/GodotSharp" "${pkgdir}/opt/godot/godot-latest-mono-win64-bin.d/GodotSharp"
	ln -s "/opt/godot/godot-latest-mono-win64-bin.d/godot-latest-mono-win64-bin.exe" "${pkgdir}/opt/godot/godot-latest-mono-win64-bin.exe"
	ln -s "/opt/godot/godot-latest-mono-win64-bin.d/godot-latest-mono-win64cmd-bin.exe" "${pkgdir}/opt/godot/godot-latest-mono-win64cmd-bin.exe"
}


#################
# Godot4 Latest #
#################

pkgname+=(
	"godot4-latest-src"
	##################
	# Godot GDScript #
	##################
	"godot4-latest-bin"
	"godot4-latest-bin32"
	"godot4-latest-export-templates-bin"
	"libgodot4-latest-bin"
	"godot4-latest-web-bin"
	"godot4-latest-osx-bin"
	"godot4-latest-win32-bin"
	"godot4-latest-win64-bin"
	"godot4-latest-android-apk-bin"
	"godot4-latest-android-aab-bin"
	##############
	# Godot Mono #
	##############
	"godot4-latest-mono-bin"
	"godot4-latest-mono-bin32"
	"godot4-latest-mono-export-templates-bin"
	"godot4-latest-mono-osx-bin"
	"godot4-latest-mono-win32-bin"
	"godot4-latest-mono-win64-bin"
	)

pkgdescaltlatest="Godot4 Latest Game Engine: An advanced, feature packed, multi-platform 2D and 3D game engine."

package_godot4-latest-src(){
	pkgdesc="${pkgdescaltlatest} Latest SourceCode"
	groups+=(
		"godot-latest"
		"godot-src"
	)
	install -d "${pkgdir}/opt/godot/src/godot4-latest/"
	cp -r "${srcdir}/godot-${pkgver}-stable/"* "${pkgdir}/opt/godot/src/godot4-latest/"
}

##################
# Godot GDScript #
##################

package_godot4-latest-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_64" "${pkgdir}/opt/godot/godot4-latest-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-latest-bin" "${pkgdir}/usr/bin/godot4-latest-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-latest-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Latest Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot4-latest-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot4-latest-bin32(){
	pkgdesc="${pkgdescaltlatest} Latest Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_linux.x86_32" "${pkgdir}/opt/godot/godot4-latest-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-latest-bin32" "${pkgdir}/usr/bin/godot4-latest-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-latest-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Latest Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Binary Version 32b"
		Comment=Application for making games
		Exec=/usr/bin/godot4-latest-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot4-latest-export-templates-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Export Templates Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_export_templates.tpz" "${pkgdir}/opt/godot/godot4-latest-export-templates-bin.tpz"
}

package_libgodot4-latest-bin(){
	pkgdesc="${pkgdescaltlatest} Latest LibGodot4 Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-lib"
	)
	install -Dm755 "${srcdir}/godot-lib.${pkgver}.stable.template_release.aar" "${pkgdir}/opt/godot/godot-lib/libgodot4-latest-bin.aar"
}

package_godot4-latest-web-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Web Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-web"
	)
	unzip "Godot_v${pkgver}-stable_web_editor.zip" -d "${srcdir}/godot4-latest-web-bin.d"
	install -d "${pkgdir}/opt/godot/"
	cp -r "${srcdir}/godot4-latest-web-bin.d" "${pkgdir}/opt/godot/"
}

package_godot4-latest-osx-bin(){
	pkgdesc="${pkgdescaltlatest} Latest MacOSX Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot4-latest-osx-bin"
}

package_godot4-latest-win32-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Windows Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32.exe" "${pkgdir}/opt/godot/godot4-latest-win32-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.cmd" "${pkgdir}/opt/godot/godot4-latest-win32-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win32_console.exe" "${pkgdir}/opt/godot/godot4-latest-win32cmd-bin.exe"
}

package_godot4-latest-win64-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Windows Binary Version 64b"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64.exe" "${pkgdir}/opt/godot/godot4-latest-win64-bin.exe"
	#install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.cmd" "${pkgdir}/opt/godot/godot4-latest-win64-bin.cmd"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_win64_console.exe" "${pkgdir}/opt/godot/godot4-latest-win64cmd-bin.exe"
}

package_godot4-latest-android-apk-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Android APK Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-android-apk"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.apk" "${pkgdir}/opt/godot/godot4-latest-android-bin.apk"
}

package_godot4-latest-android-aab-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Android AAB Binary Version"
	groups+=(
		"godot-latest"
		"godot-gdscript"
		"godot-android-aab"
		"godot-android"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_android_editor.aab" "${pkgdir}/opt/godot/godot4-latest-android-bin.aab"
}

##############
# Godot Mono #
##############
package_godot4-latest-mono-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Mono Binary Version"
	depends+=("${_monodepends}")
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-standard"
		"godot-standard64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/Godot_v${pkgver}-stable_mono_linux.x86_64" "${pkgdir}/opt/godot/godot4-latest-mono-bin.d/godot4-latest-mono-bin"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_64/GodotSharp" "${pkgdir}/opt/godot/godot4-latest-mono-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-latest-mono-bin.d/godot4-latest-mono-bin" "${pkgdir}/opt/godot/godot4-latest-mono-bin"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-latest-mono-bin.d/godot4-latest-mono-bin" "${pkgdir}/usr/bin/godot4-latest-mono-bin"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-latest-mono-bin.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Latest Mono Binary v${pkgver}
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Mono Binary Version"
		Comment=Application for making games
		Exec=/usr/bin/godot4-latest-mono-bin %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot4-latest-mono-bin32(){
	pkgdesc="${pkgdescaltlatest} Latest Mono Binary Version 32b"
	depends+=("${_monodepends}")
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-standard"
		"godot-standard32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/Godot_v${pkgver}-stable_mono_linux.x86_32" "${pkgdir}/opt/godot/godot4-latest-mono-bin32.d/godot4-latest-mono-bin32"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_linux_x86_32/GodotSharp" "${pkgdir}/opt/godot/godot4-latest-mono-bin32.d/GodotSharp"
	ln -s "/opt/godot/godot4-latest-mono-bin32.d/godot4-latest-mono-bin32" "${pkgdir}/opt/godot/godot4-latest-mono-bin32"
	
	install -d "${pkgdir}/usr/bin/"
	ln -s "/opt/godot/godot4-latest-mono-bin32.d/godot4-latest-mono-bin32" "${pkgdir}/usr/bin/godot4-latest-mono-bin32"
	
	install -d "${pkgdir}/usr/share/applications/"
	cat > "${pkgdir}/usr/share/applications/godot4-latest-mono-bin32.desktop" <<-EOF
		[Desktop Entry]
		Name=Godot4 Engine Latest Mono Binary v${pkgver} 32b
		GenericName="Advanced cross-platform 2D and 3D libre game engine. Latest Mono Binary Version 32b"
		Comment=Application for making games.
		Exec=/usr/bin/godot4-latest-mono-bin32 %U
		Icon=godot
		Terminal=false
		Type=Application
		MimeType=application/x-godot-project;
		Categories=Development;IDE;
	EOF
}

package_godot4-latest-mono-export-templates-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Export Templates Mono Binary Version"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-export-templates"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_export_templates.tpz" "${pkgdir}/opt/godot/godot4-latest-mono-export-templates-bin.tpz"
}

package_godot4-latest-mono-osx-bin(){
	pkgdesc="${pkgdescaltlatest} Latest MacOSX Mono Binary Version"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-osx"
		"godot-osx-universal"
	)
	install -Dm755 "${srcdir}/Godot_mono.app/Contents/MacOS/Godot" "${pkgdir}/opt/godot/godot4-latest-mono-osx-bin.d/godot4-latest-mono-osx-bin"
	cp -r "${srcdir}/Godot_mono.app/Contents/Resources/GodotSharp" "${pkgdir}/opt/godot/godot4-latest-mono-osx-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-latest-mono-osx-bin.d/godot4-latest-mono-osx-bin" "${pkgdir}/opt/godot/godot4-latest-mono-osx-bin"
}

package_godot4-latest-mono-win32-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Windows Mono Binary Version 32b"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-win"
		"godot-win32"
		"godot-32"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win32-bin.d/godot4-latest-mono-win32-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win32/Godot_v${pkgver}-stable_mono_win32_console.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win32-bin.d/godot4-latest-mono-win32cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win32/GodotSharp" "${pkgdir}/opt/godot/godot4-latest-mono-win32-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-latest-mono-win32-bin.d/godot4-latest-mono-win32-bin.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win32-bin.exe"
	ln -s "/opt/godot/godot4-latest-mono-win32-bin.d/godot4-latest-mono-win32cmd-bin.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win32cmd-bin.exe"
}

package_godot4-latest-mono-win64-bin(){
	pkgdesc="${pkgdescaltlatest} Latest Windows Mono Binary Version 64b"
	groups+=(
		"godot-latest"
		"godot-mono"
		"godot-win"
		"godot-win64"
		"godot-64"
	)
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win64-bin.d/godot4-latest-mono-win64-bin.exe"
	install -Dm755 "${srcdir}/Godot_v${pkgver}-stable_mono_win64/Godot_v${pkgver}-stable_mono_win64_console.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win64-bin.d/godot4-latest-mono-win64cmd-bin.exe"
	cp -r "${srcdir}/Godot_v${pkgver}-stable_mono_win64/GodotSharp" "${pkgdir}/opt/godot/godot4-latest-mono-win64-bin.d/GodotSharp"
	ln -s "/opt/godot/godot4-latest-mono-win64-bin.d/godot4-latest-mono-win64-bin.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win64-bin.exe"
	ln -s "/opt/godot/godot4-latest-mono-win64-bin.d/godot4-latest-mono-win64cmd-bin.exe" "${pkgdir}/opt/godot/godot4-latest-mono-win64cmd-bin.exe"
}
